<?php
class Aboutus_Model extends ORM {
	
	protected $table_name = 'aboutus';
	protected $primary_key = 'aboutus_id';
	protected $col_sort_order = 'aboutus_sort_order';
	protected $col_aboutus_status = 'aboutus_status';
	protected $sorting = array('aboutus_update_date' => 'desc');
	
	public function get()
	{
		$this->db->from($this->table_name);
		$this->db->select('*');
		$this->db->orderby($this->col_sort_order,'desc');
		$this->db->orderby($this->primary_key,'desc');
		$query = $this->db->get();
		return $query->result_array(false);
		
	}
	
	public function get_with_active($language)
	{
		$this->db->select('*');
		$this->db->from($this->table_name);
		$this->db->join('aboutus_content', 'aboutus_content.aboutus_id', 'aboutus.aboutus_id');
		$this->db->where('aboutus_content.languages_id',$language);
		$this->db->where($this->col_aboutus_status,'1');
		$this->db->orderby('aboutus.'.$this->col_sort_order,'desc');
		$this->db->orderby('aboutus.'.$this->primary_key,'desc');
		$query = $this->db->get();
		return $query->result_array(false);
		
	}
}
?>